package org.iabako.client.ui.page.business.conversation;

import org.iabako.client.config.page.PageTagItemEnum;
import org.iabako.client.navigation.NavigationController;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.client.ui.form.AbstractForm;
import org.iabako.client.ui.form.business.conversation.ConversationForm;
import org.iabako.shared.entity.business.AbstractEntity;
import org.iabako.shared.entity.business.Client;
import org.iabako.shared.entity.business.ClientConversation;

/**
 * Created by jose on 13/02/15.
 */
public class ConversationModify extends ConversationForm {


    public ConversationModify(AbstractForm parentForm) {
        super();

        this.parentForm = parentForm;

        String[] params = NavigationController.getInstance().getParams();

        clientConversationServiceAsync.getById(Long.parseLong(params[0]), new IabakoAsyncCallback<AbstractEntity>() {
            public void onSuccess(AbstractEntity result) {
                setConversation((ClientConversation) result);
                popup.setSelectedTag(PageTagItemEnum.ClientInformation);
                super.onSuccess(result);
            }
        });
    }
}
